<template>
  <div
    tabindex="0"
    class="table-row-action" 
    @keydown.space.prevent="onClick()" 
    @keydown.enter.prevent="onClick()"           
    v-on="$listeners"
    ref="trigger"
    >
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'CvTableRowAction',
  methods: {
    onClick() {
      this.$refs.trigger.click();
    },
  },
};
</script>

<style lang="scss" scoped>
.table-row-action {
  cursor: pointer;
  margin-left:8px;
  display:inline;
}

.table-row-action:focus {
    outline: 1px solid #0f62fe;
    // outline-offset: -2px;
}
</style>